package vip.xiaonuo.core.exception.enums;

import lombok.Getter;

/**
 * <p>Title : </p>
 * <p>Description : </p>
 * <p>DevelopTools : IDEA</p>
 * <p>DevelopSystem : Windows11</p>
 *
 * @Author : zxw
 * @Date 2023/8/21 14:08
 */
@Getter
public class ParamException extends RuntimeException {

    private final Integer code;

    private final String errorMessage;

    public ParamException(ParamExceptionEnum exception) {
        super(exception.getMessage());
        this.code = exception.getCode();
        this.errorMessage = exception.getMessage();
    }

    public ParamException(Integer code, String message) {
        super(message);
        this.code = code;
        this.errorMessage = message;
    }

}
